home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_07
/
greissma
/
point.h
< prev
Wrap
C/C++ Source or Header
|
1994-03-09
|
704b
|
30 lines
Listing 6: Implementation of a Point Mapped object
class Point : public MappedObject {
int x, y;
char *text;
static Map map;
static Field *fieldv[];
public:
Point();
Point( int x, int y, char *text );
} ;
Field *Point::fieldv[] = {
new IntField ( "x", offsetof( Point, x ) ),
new IntField ( "y", offsetof( Point, y ) ),
new CharField ( "text", offsetof( Point, text ) ),
} ;
Map Point::map( "Point", fieldv, sizeof(Point::fieldv) / sizeof(Point*) );
Point::Point()
:MappedObject( map ), x( 0 ), y( 0 ), text( "" )
{
}
Point::Point( int x, int y, char *text )
:MappedObject( map ), x( x ), y( y ), text( text )
{
}